package mumethod;

import java.util.List;

import muobject.StudentSummary;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;

public class StudentSummaryReportDataSource implements JRDataSource{
	
	private List<StudentSummary> datas = null ;
	private int loop = -1 ; 
	
	public StudentSummaryReportDataSource(List<StudentSummary> data){
		this.datas = data;
	}
	
	public Object getFieldValue(JRField field) throws JRException {
		StudentSummary temp = (StudentSummary)this.datas.get(loop);
		Object rs = "" ;
		if("sno".equals(field.getName())){  
			rs = temp.getSno();   
		}else if("shcname".equals(field.getName())){
			rs = temp.getShcname();
		}else if("shename".equals(field.getName())){
			rs = temp.getShename();
		}else if("publictype".equals(field.getName())){
			rs = temp.getPublictype();
		}else if("daytype".equals(field.getName())){
			rs = temp.getDaytype();
		}else if("tel".equals(field.getName())){
			rs = temp.getTel();
		}else if("fax".equals(field.getName())){
			rs = temp.getFax();
		}else if("address".equals(field.getName())){
			rs = temp.getAddress();
		}else if("tname".equals(field.getName())){
			rs = temp.getTname();
		}else if("ttel".equals(field.getName())){
			rs = temp.getTtel();
		}else if("temail".equals(field.getName())){
			rs = temp.getTemail();
		}else if("president".equals(field.getName())){
			rs = temp.getPresident();
		}else if("registerdate".equals(field.getName())){
			rs = temp.getRegisterdate();
		}else if("stno".equals(field.getName())){
			rs = temp.getStno();
		}else if("grade".equals(field.getName())){
			rs = temp.getGrade();
		}else if("sclass".equals(field.getName())){
			rs = temp.getSclass();
		}else if("classno".equals(field.getName())){
			rs = temp.getClassno();
		}else if("ename".equals(field.getName())){
			rs = temp.getEname();
		}else if("cname".equals(field.getName())){
			rs = temp.getCname();
		}else if("sex".equals(field.getName())){
			rs = temp.getSex();
		}else if("birthday".equals(field.getName())){
			rs = temp.getBirthday();
		}else if("years".equals(field.getName())){
			rs = temp.getYears();
		}else if("age".equals(field.getName())){
			rs = temp.getAge();
		}else if("hwscore".equals(field.getName())){
			rs = temp.getHwscore();
		}else if("gripscore".equals(field.getName())){
			rs = temp.getGripscore();
		}else if("jumpscore".equals(field.getName())){
			rs = temp.getJumpscore();
		}else if("situpscore".equals(field.getName())){
			rs = temp.getSitupscore();
		}else if("vcapacityscore".equals(field.getName())){
			rs = temp.getVcapacityscore();
		}else if("run69score".equals(field.getName())){
			rs = temp.getRun69score();
		}else if("run15score".equals(field.getName())){
			rs = temp.getRun15score();
		}else if("totalscore".equals(field.getName())){
			rs = temp.getTotalscore();
		}else if("plevel".equals(field.getName())){
			rs = temp.getPlevel();
		}else if("testdate".equals(field.getName())){
			rs = temp.getTestdate();
		}else if("height".equals(field.getName())){
			rs = temp.getHeight();
		}else if("weight".equals(field.getName())){
			rs = temp.getWeight();
		}else if("BMI".equals(field.getName())){
			rs = temp.getBMI();
		}else if("standard".equals(field.getName())){
			rs = temp.getStandard();
		}else if("d1score".equals(field.getName())){
			rs = temp.getD1score();
		}else if("d2score".equals(field.getName())){
			rs = temp.getD2score();
		}else if("d3score".equals(field.getName())){
			rs = temp.getD3score();
		}else if("d4score".equals(field.getName())){
			rs = temp.getD4score();
		}else if("d5score".equals(field.getName())){
			rs = temp.getD5score();
		}else if("d6score".equals(field.getName())){
			rs = temp.getD6score();
		}else if("d7score".equals(field.getName())){
			rs = temp.getD7score();
		}else if("d8score".equals(field.getName())){
			rs = temp.getD8score();
		}else if("d9score".equals(field.getName())){
			rs = temp.getD9score();
		}else if("d10score".equals(field.getName())){
			rs = temp.getD10score();
		}else if("d11score".equals(field.getName())){
			rs = temp.getD11score();
		}else if("d12score".equals(field.getName())){
			rs = temp.getD12score();
		}else if("d13score".equals(field.getName())){
			rs = temp.getD13score();
		}else if("d14score".equals(field.getName())){
			rs = temp.getD14score();
		}else if("d15score".equals(field.getName())){
			rs = temp.getD15score();
		}else if("dtotalscore".equals(field.getName())){
			rs = temp.getDtotalscore();
		}else if("f1score".equals(field.getName())){
			rs = temp.getF1score();
		}else if("f2score".equals(field.getName())){
			rs = temp.getF2score();
		}else if("f3score".equals(field.getName())){
			rs = temp.getF3score();
		}else if("f4score".equals(field.getName())){
			rs = temp.getF4score();
		}else if("f5score".equals(field.getName())){
			rs = temp.getF5score();
		}else if("f6score".equals(field.getName())){
			rs = temp.getF6score();
		}else if("f7score".equals(field.getName())){
			rs = temp.getF7score();
		}else if("f8score".equals(field.getName())){
			rs = temp.getF8score();
		}else if("f9score".equals(field.getName())){
			rs = temp.getF9score();
		}else if("f10score".equals(field.getName())){
			rs = temp.getF10score();
		}else if("ftotalscore".equals(field.getName())){
			rs = temp.getFtotalscore();
		}else if("pcomment1".equals(field.getName())){
			rs = temp.getPcomment1();
		}else if("pcomment2".equals(field.getName())){
			rs = temp.getPcomment2();
		}else if("pcomment3".equals(field.getName())){
			rs = temp.getPcomment3();
		}else if("pcomment4".equals(field.getName())){
			rs = temp.getPcomment4();
		}else if("dcomment1".equals(field.getName())){
			rs = temp.getDcomment1();
		}else if("dcomment2".equals(field.getName())){
			rs = temp.getDcomment2();
		}else if("dcomment3".equals(field.getName())){
			rs = temp.getDcomment3();
		}else if("dcomment4".equals(field.getName())){
			rs = temp.getDcomment4();
		}else if("total".equals(field.getName())){
			rs = temp.getTotal();
		}else if("award".equals(field.getName())){
			rs = temp.getAward();
		}
		
		temp = null ;  
		return rs;
	}
	
	public boolean next() throws JRException {
		loop ++ ;
		if(loop >= datas.size()){
			return false;
		}
		else{   
			return true ;
		}
	}
	
	public void finalized(){
		datas = null ;  
	}

}
